/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
    /**
     * built-in config
     * @type {Egg.EggAppConfig}
     **/
    const config = exports = {};

    // use for cookie sign key, should change to your own and keep security
    config.keys = appInfo.name + '_1617340374474_7387';

    config.view = {
        defaultViewEngine: "nunjucks",
        mapping: {
            ".nj": "nunjucks"
        }
    }
    config.news = {
        pageSize: 5,
        serverUrl: "http://www.vgtech.com.cn/adminsys/public/json/"
    }
    config.mysql = {
        client: {
            host: "127.0.0.1",
            port: "3306",
            user: "root",
            password: "123456",
            database: "testdb"

        },
        app: true,
        agent: false,
    }

    config.sequelize = {
        dialect: 'mysql',
        host: '127.0.0.1',
        port: 3306,
        username: "root",
        password: "123456",
        database: 'testdb',
    };


    //安全验证
    config.security = {
        csrf: {
            // 判断是否需要 ignore 的方法，请求上下文 context 作为第一个参数
            enable: false
        },
    }





    // add your middleware config here
    config.middleware = ['robot'];
    config.robot = {
        ua: [
            /Baiduspider/i,
        ]
    }

    // add your user config here
    const userConfig = {
        // myAppName: 'egg',
    };

    return {
        ...config,
        ...userConfig,
    };
};